import http from '../utils/request.js'

//向外暴露这个整个discusstion表的api
export default {

    sendMsgApi(params) {

        return http.get("/user/sendMsg?phone=" + params)
    },

    //短信验证码登录
    loginByCodeApi(params) {

        return http.post("/user/loginByCode", params);
    },

    //密码登录
    loginByPasswordApi(params) {
        return http.post("/user/loginByPassword", params);
    },

    checkImgCodeApi(params) {
        return http.get("/code/checkCode?verifycode=" + params);
    },

    // 查询班级里面的学生,参数为班级id
    queryStudentInClass(params) {
        return http.get("/user/queryStudentInClass?classId=" + params);
    },

    //班级管理,查询班级下的学生通过搜索框
    queryStudentInClassSeacher(params) {
        return http.post("/user/queryStudentInClassSeacher", params);
    },

  // 更新
    updateUsers(form) {
        return http.post("/user/updateUser",
            form
        )
    },
    getUsers(id) {
        return http.post("/user/queryById", id)

    },

    queryById(id){
        //id= 1;
        return http.post('/user/queryById',{
            userId:id,
        },{
            headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' }
        })
    }


}